<template>
    <div class="flrc pad5 loading-text">
        <mu-circular-progress
                color="green"
                :mode="done?'determinate':'indeterminate'"
                :stroke-width="3"
                :size="24"
                :value="100"></mu-circular-progress>
        <div class="trans" :class="{c01:done,c12:!done,open:show,close:!show}">
            <slot></slot>
        </div>
        <div v-show="done">
            <mu-icon color="success" value="check_circle"></mu-icon>
        </div>
    </div>
</template>

<script>
    export default {
        name: "EzLoading",
        props:{
            done:false
        },
        data(){
            return{
                show:false
            }
        },
        mounted() {
            this.$nextTick(()=>{
                this.show = true
            })
        }
    }
</script>

<style scoped>
    .loading-text .trans {
        transition: width;
        transition-delay: 0.3s;
        transition-duration: 0.5s;
        overflow: hidden;
    }
 .loading-text .open{
     width: 300px;
     word-break: keep-all;
 }
 .loading-text .close{
     width: 0;
     word-break: keep-all;
     /*display: none;*/
 }
</style>